#include"client.hpp"
#include<memory>


using namespace std;
using namespace nt_client;

void Usage(const char* program)
{
    cout<<"Usage:"<<endl;
    cout<<"\t"<<program<<"ServerIp Serverport"<<endl;
}

int main(int argc,char* argv[])
{
    if(argc!=3)
    {
        Usage(argv[0]);
        return USAGE_ERR;
    }

    //获取传来的端口号和IP地址
    string ip=argv[1];
    uint16_t port=stoi(argv[2]);

    unique_ptr<TcpClient> usvr(new TcpClient(ip,port));
    
    usvr->InitClient();
    usvr->StartClient();

    return 0;
}